package Review2;

public class Test13 {
    public void deleteNode(ListNode head,ListNode node){
    	if(head==null||node==null){
    		return;
    	}
    	if(node==head&&head.next==null){
    		head=null;
    		return;
    	}
    	if(node.next!=null){
    		node.value = node.next.value;
    		node.next = node.next.next;
    		return;
    	}
    	if(node.next==null){
    		ListNode p = head;
    		while(p.next!=node){
    			p=p.next;
    		}
    		p.next=null;
    		return;
    	}
    }
}
